package com.annotation.enums;

public enum Season implements AbstractEnum{

    SPRING("SPRING","春天"),
    SUMMER("SUMMER","夏天"),
    AUTUMN("AUTUMN","秋天"),
    WINTER("WINTER","冬天");

    Season(String code, String name){
        this.code = code;
        this.name = name;
    }

    private String code;

    private String name;

    public static Season getEnum(String str){
        Season[] seasons = values();
        for (Season season : seasons) {
            if (season.getCode().equals(str)){
                return season;
            }
        }
        return null;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getName() {
        return name;
    }
}
